<%@ page import="java.util.ArrayList" %>
<%@ page import="com.student.pojo.StuInfo" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>修改学生信息</title>
    <link rel="stylesheet" href="jQuery/login.css" type="text/css"/>
    <style type="text/css">
        #header {
            color: black;
            font-size: 40px;
            border: 0px solid black;
            margin-left: 600px;
            line-height: 120px;
            height: 120px;
            font-family: '楷体';
        }

        #login_frame {
            width: 400px;
            height: 450px;
            position: absolute;
            left: 50%;
            top: 50%;
            margin-left: -200px;
            margin-top: -230px;
            background-color: rgba(240, 254, 255, 0.5);
            border-radius: 10px;
            text-align: center;
        }
    </style>
</head>
<%
    ArrayList stuInfoList = (ArrayList) request.getAttribute("stuInfoList");
%>
<%
    for (int i = 0; i < stuInfoList.size(); i++) {
        StuInfo stuInfo = (StuInfo) stuInfoList.get(i);
%>
<div id="login_frame">
    <form action="student.do" method="post" align="center" style="padding-top: 30px;border: 0px solid rebeccapurple">
        <input type="hidden" name="opr" value="updateStudent"/>
        <input type="hidden" name="id" value="<%=stuInfo.getId() %>" >
        &nbsp;姓名:&nbsp;&nbsp;&nbsp;<input class="text_field" type="text" name="name" required
                                          value="<%=stuInfo.getName()%>"
                                          maxlength="20"> <br/><br/>
        &nbsp;密码:&nbsp;&nbsp;&nbsp;<input class="text_field" type="password" name="password"    required minlength="6"
                                          value="<%=stuInfo.getPassword()%>"
                                          maxlength="6"> <br/><br/>
        年龄:&nbsp;&nbsp;&nbsp;<input class="text_field" type="text" name="age"
                                    value="<%=stuInfo.getAge()%>"
                                     required><br/><br/>
        体重:&nbsp;&nbsp;&nbsp;<input class="text_field" type="text" name="weight"
                                    value="<%=stuInfo.getWeight()%>"
                                      required><br/><br/>
        身高:&nbsp;&nbsp;&nbsp;<input class="text_field" type="text" name="height"
                                    value="<%=stuInfo.getHeight()%>"
                                    required><br/><br/>
   ><br/><br/>
        <%-- 性别 --%>
        性别：
        <%
            if (stuInfo.getSex().equals("男")) {
        %>
        <input type="radio" name="sex" id="sexY" value="男" checked /><label for="sexY">男</label>
        <input type="radio" name="sex" id="sexF" value="女" /><label for="sexF">女</label>
        <%
        }
        else if (stuInfo.getSex().equals("女")){
        %>
        <input type="radio" name="sex" id="sexY" value="男" /><label for="sexY">男</label>
        <input type="radio" name="sex" id="sexF" value="女" checked /><label for="sexF">女</label>
        <%
            }
        %>
        <br/><br/>
        <%-- 角色 --%>
        角色：
        <%
            if (stuInfo.getRole().equals("用户")) {
        %>
        <input type="radio" name="role" id="roleY" value="用户" checked /><label for="roleY">用户</label>
        <input type="radio" name="role" id="roleF" value="管理员" /><label for="roleF">管理员</label>
        <%
        }
        else if (stuInfo.getRole().equals("管理员")){
        %>
        <input type="radio" name="role" id="roleY" value="用户" /><label for="roleY">用户</label>
        <input type="radio" name="role" id="roleF" value="管理员" checked /><label for="roleF">管理员</label>
        <%
            }
        %>
        <br/><br/>
        <input type="submit" value="修改"><br /><br />
        <a href="javascript:history.back(-1);" class="a">返回</a>
    </form>
</div>
<%
    }
%>
</body>
</html>
